package com.itheima.jdk8date;

import java.time.LocalDateTime;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个年份:");
        int year = sc.nextInt();
        LocalDateTime dateTime = LocalDateTime.of(year, 3, 1, 20, 13, 14);
        LocalDateTime targetTime = dateTime.plusDays(-1);
        int days = targetTime.getDayOfMonth();
        System.out.println(year+"年的2月共有:" + days+"天");

    }
}
